﻿//*******************************************************************************************************
// BooleanToColorConverter.cs - Converts Boolean value to SolidColorBrush
//  Copyright © 2008 - TVA, all rights reserved - Gbtc
//
//  Build Environment: C#, Visual Studio 2008
//  Primary Developer: Mehulbhai Thakkar, TVA//      
//       Phone: 423/751-3370
//       Email: mpthakka@tva.gov
//*******************************************************************************************************

using System;
using System.Windows.Data;
using System.Windows.Media;

namespace PmuRegistry.Silverlight.Converters
{
	public class BooleanToColorConverter : IValueConverter
	{
		#region IValueConverter Members

		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			SolidColorBrush scBrush = new SolidColorBrush();

			if ((bool)value)
				scBrush.Color = Color.FromArgb(255, 10, 255, 25);
			else
				scBrush.Color = Color.FromArgb(255, 255, 10, 10);

			return scBrush as Brush;
		}

		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			return null;
		}

		#endregion
	}
}
